package com.lb.design.strategy;

import java.util.HashMap;
import java.util.Map;

/**
 * @ClassName： Factory
 * @Description：
 * @Author: 蓝莲花
 * @Date： 2024/1/11 22:02
 * @Version： V1.0
 */
public class Factory {
    public static Map<String, Handler> strategyMap = new HashMap<>();

    public static Handler getInvokeStrategy(String name) {
        return strategyMap.get(name);
    }

    public static void register(String name, Handler handler) {
        if (name == null || handler == null) {
            return;
        }

        strategyMap.put(name, handler);
    }
}
